package com.im.server.enterprise.common.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.im.server.enterprise.common.bean.Department;
import com.im.server.enterprise.common.bean.DepartmentMember;
import com.im.server.enterprise.common.dao.DepartmentDAO;
import com.im.server.enterprise.common.dao.DepartmentMemberDAO;
import com.im.server.general.common.bean.UserHead;
import com.im.server.general.common.dao.UserDAO;
import com.im.server.general.common.dao.UserHeadDAO;
import com.onlyxiahui.im.message.data.UserData;

/**
 * @author XiaHui
 * @date 2017年8月13日 上午8:50:21
 */
@Service
public class DepartmentService {

	@Resource
	private UserDAO userDAO;
	@Resource
	private UserHeadDAO userHeadDAO;
	@Resource
	private DepartmentDAO departmentDAO;
	@Resource
	private DepartmentMemberDAO departmentMemberDAO;

	

	public List<UserData> getAllUserDataList() {
		String sql = "select * from im_user ";
		List<UserData> list = userDAO.queryList(sql, null, UserData.class, null);
		return list;
	}

	public List<UserHead> getAllUserHeadList() {
		String sql = "select * from im_user_head ";
		List<UserHead> list = userHeadDAO.queryList(sql, null, UserHead.class, null);
		return list;
	}

	public Department getDepartment(String id) {
		return departmentDAO.get(id);
	}

	public List<Department> getAllDepartmentList() {
		return departmentDAO.getAllList();
	}

	public List<DepartmentMember> getAllDepartmentMemberList() {
		return departmentMemberDAO.getAllList();
	}
}
